package com.craney.aboutDisplay{
    import flash.display.Sprite;
    import flash.display.Stage;

    public class Temp1 extends Sprite {
    	public static var stg:Stage;
    	
        public function Temp1(spt:Stage) {
        	stg = spt;
            var button:CustomSimpleButton = new CustomSimpleButton();
            addChild(button);
        }
    }
}

import flash.display.DisplayObject;
import flash.display.Shape;
import flash.display.SimpleButton;
import com.craney.aboutDisplay.Temp1;

class CustomSimpleButton extends SimpleButton {
    private var upColor:uint   = 0xFFCCff;
    private var overColor:uint = 0xCCFF00;
    private var downColor:uint = 0x00CCFF;
    private var size:uint      = 80;

    public function CustomSimpleButton() {
        downState      = new ButtonDisplayState(downColor, size);
        downState.x = 0;
        downState.y = 0;
        
        overState      = new ButtonDisplayState(overColor, size);
        overState.x = 100
        overState.y = 0;
        
        upState        = new ButtonDisplayState(upColor, size);
		upState.x = 200;
		upState.y = 0;
        
        hitTestState   = new ButtonDisplayState(0xffffff, size);
        hitTestState.x = 300;
        hitTestState.y = 0;
        
        Temp1.stg.addChild(hitTestState);
        
        useHandCursor  = true;
    }
}

class ButtonDisplayState extends Shape {
    private var bgColor:uint;
    private var size:uint;

    public function ButtonDisplayState(bgColor:uint, size:uint) {
        this.bgColor = bgColor;
        this.size    = size;
        draw();
    }

    private function draw():void {
        graphics.beginFill(bgColor);
        graphics.drawRect(120, 120, size, size);
        graphics.endFill();
    }
}
